package gecko.view.swing;

import gecko.control.CtrlGecko;
import gecko.view.IObservable;

import java.awt.*;

import javax.swing.*;


public class VUser extends JFrame implements IObservable {
	private JPanel pPrinc;
    private JLabel lEntete;
    private JLabel lMenu;
    protected JLabel lCorps;
    private JLabel lPied;
    protected static CtrlGecko controleur;
    private static final long serialVersionUID = 1L;
	private boolean Logo = false;

    public boolean isLogo() {
		return Logo;
	}

	public void setLogo(boolean logo) {
		Logo = logo;
	}

	public void place() {

        this.setSize(1440, 900);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setVisible(true);
        
    }

    public VUser(CtrlGecko controleur, boolean logo) {

    	this.Logo = logo;
        // Ajout Controleur
        VUser.controleur = controleur;

        // Creation et Ajout des composants
        pPrinc = new JPanel();
        pPrinc.setBackground(Color.white);
        pPrinc.setBorder(BorderFactory.createEmptyBorder(-6, 0, 0, 0));
        
        lEntete = new JLabel(new ImageIcon("images/background/entete.png"));
        lEntete.setBorder(BorderFactory.createEmptyBorder(-2, 0, -5, 0));        

        
        lMenu = new JLabel(new ImageIcon("images/background/menu.png"));
        lMenu.setLayout(new GridLayout(1,5));
        
        JButton bGestion = new JButton(new ImageIcon("images/menu/Top/Gestion_B.png"));
        bGestion.addActionListener(controleur);
        bGestion.setActionCommand("GESTION_USER");
        bGestion.setBorderPainted(false);
        
        bGestion.setOpaque(false);
        bGestion.setContentAreaFilled(false);
        bGestion.setFocusPainted(false);
        
        JButton bRecherche = new JButton(new ImageIcon("images/menu/Top/Recherche_B.png"));
        bRecherche.addActionListener(controleur);
        bRecherche.setActionCommand("RECHERCHE_USER");
        bRecherche.setBorderPainted(false);
        
        bRecherche.setOpaque(false);
        bRecherche.setContentAreaFilled(false);
        bRecherche.setFocusPainted(false);
        
        JButton bAlerte = new JButton(new ImageIcon("images/menu/Top/Alerte_B.png"));
        bAlerte.addActionListener(controleur);
        bAlerte.setActionCommand("ALERTE_USER");  
        bAlerte.setBorderPainted(false);
        
        bAlerte.setOpaque(false);
        bAlerte.setContentAreaFilled(false);
        bAlerte.setFocusPainted(false);
        
        JButton bEmpty = new JButton(new ImageIcon("images/menu/Top/Empty.png"));
        bEmpty.setBorderPainted(false);
        
        bEmpty.setOpaque(false);
        bEmpty.setContentAreaFilled(false);
        bEmpty.setFocusPainted(false);
        
        JButton bDeco = new JButton(new ImageIcon("images/menu/Top/Deconnexion_B.png"));
        bDeco.addActionListener(controleur);
        bDeco.setActionCommand("DECONNEXION");  
        bDeco.setBorderPainted(false);
        
        bDeco.setOpaque(false);
        bDeco.setContentAreaFilled(false);
        bDeco.setFocusPainted(false);
        
        lMenu.setLayout(new BoxLayout(lMenu, BoxLayout.LINE_AXIS));
        lMenu.add(bGestion);
        lMenu.add(bRecherche);
        lMenu.add(bAlerte);
        lMenu.add(bEmpty);
        lMenu.add(bDeco);

        if(Logo==true){
        	lCorps = new JLabel(new ImageIcon("images/background/corpsLogin.png"));
        	lCorps.setLayout(new BorderLayout()); 

        } else{
        	lCorps = new JLabel(new ImageIcon("images/background/corps.png"));
        	lCorps.setLayout(new BorderLayout()); 
        }
 
        lPied = new JLabel(new ImageIcon("images/background/piedpage.png"));

        pPrinc.add(lEntete);
        pPrinc.add(lMenu);
        pPrinc.add(lCorps);
        pPrinc.add(lPied);
        

        // Ajout de ces conteneurs au conteneur de ma fenetre
        this.add(pPrinc);

        // Assemblage de la fenetre
        this.pack();
        this.place();

    }

	@Override
	public String getUtilisateur() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getPassword() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieService() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieNom() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieNumero() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieVille() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieCP() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getIDServ() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getIDTypo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieTypo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getService() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getFourn() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getTypo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSign() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getLbl() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean getActif() {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public String getDelai() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getIDFourn() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieSign() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieLib() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String recupService(String resultService) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getSaisieRue() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getJour() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public JTable getTab() {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public String getSaisieAdresse() {
		// TODO Auto-generated method stub
		return null;
	}


	@Override
	public String getAnneeFin() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getMoisFin() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getMois() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getAnnee() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getJourFin() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String importer() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getIDContrat() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public VTab getMod() {
		// TODO Auto-generated method stub
		return null;
	}
}

